package day1108.demo03;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/8 16:03
 */

public class Test {
    public static void main(String[] args) throws InterruptedException {
        TOne tOne = new TOne();
        tOne.start();
        Thread.sleep(2000);
        System.out.println("线程可见性");
        tOne.setFlag(false);
        //设置flag为flase就是把while终止 终止线程

    }
}
